<!doctype html>
<html>
<head>
    <meta charset="UTF-8">
    <title>ntko</title>
    <meta http-equiv="Cache-Control" content="no-siteapp" />
    <link href="css/webuploader.css" rel="stylesheet" />
    <link rel="shortcut icon" href="css/favicon.ico" type="image/x-icon" />
    <script type="text/javascript" src="js/jquery-3.2.3.min.js"></script>
    <script type="text/javascript" src="ntkoofficecontrol.js"></script>
    <script type="text/javascript">
        var nOpen = 0;
        var IsTaoHong = false;
        var nTaoHong = 0;
        var url= "http://csfile.szoa.sz.gov.cn/file/download?staticToken=f1634ed30b374f159a684ef353184f16";

        function OpenFile()
        {

            var obj = document.getElementById("TANGER_OCX");
            //obj.FullScreenMode = true;
            //obj.IsRemoveMacrosOnSave = false;
            //obj.SetMacroSecurityLevelOffice(-1);
            //obj.IsShowNetErrorMsg = false;
            //obj.IsShowFileErrorMsg = false;
            //alert("IsOptForOpenSpeed："+obj.IsOptForOpenSpeed);
            obj.IsOptForOpenSpeed = true;
            //添加自定义菜单
            //obj.AddCustomMenu2(1,"我的菜单");//添加主菜单
            //obj.AddCustomMenuItem2(1,0,-1,false,"我的子菜单");
            //obj.TitleBar = false;
            //obj.AddCustomButtonOnMenu(0,"xxxx",true)
            //加载PDF插件

            //obj.AddDocTypePlugin(".pdf","PDF.NtkoDocument","4,0,0,1","ntkooledocall.cab",51,true);

            try
            {
                obj.BeginOpenFromURL("https://csfile.szoa.sz.gov.cn/file/download?staticToken=f1634ed30b374f159a684ef353184f16&md5Path=cbe04d927c032ce6495bbd5942677bd0@38912");
                //obj.OpenFromURL("http://127.0.0.1/static/2222.docx");
            }
            catch(e)
            {
                alert(e);
            }
        }
        function SaveFile()
        {
            var obj = document.getElementById("TANGER_OCX");
            var ret = obj.SaveToURL("http://localhost:1986/ntkooffice/Upload.jsp","fileUpload","userName=李军","1.docx","MyFile");

        }

        function SavePDFTOURL()
        {
            var obj = document.getElementById("TANGER_OCX");
            obj.PublishAsPDFToURL(url+"Upload.jsp","fileUpload","","1.pdf","MyFile");
        }

    </script>
    <!--<script language="JScript" for="TANGER_OCX" event="AfterPublishAsPDFToURL(data,Code)">-->
        <!--alert("AfterPublishAsPDFToURL："+Code);-->
    <!--</script>-->

    <!--<script type="text/javascript" for="TANGER_OCX" event="OnClickCustomContextMenu(MenuIndex)">-->
        <!--var obj = document.getElementById("TANGER_OCX");-->

        <!--if(MenuIndex == 1)//菜单项索引-->
        <!--{-->
            <!--alert(MenuIndex);-->
        <!--}-->
    <!--</script>-->
    <!--<script type="text/javascript" for="TANGER_OCX" event="OnWordBeforeRightClick(Selection, IsCancel)">-->
        <!--return;-->
        <!--alert("右键事件");-->
        <!--document.getElementById("TANGER_OCX").CustomMenuStr = "插入表格=1&插入图片=2&插入文字=3";//自定义右键菜单项-->
        <!--document.getElementById("TANGER_OCX").CancelWordRightClick = true;-->
    <!--</script>-->

    <!--<script type="text/javascript" for="TANGER_OCX" event="OnCustomMenuCmd2(menuPos,submenuPos,subsubmenuPos,menuCaption,myMenuID)">-->
        <!--alert("Open");-->
    <!--</script>-->
    <!--<script type="text/javascript" for="TANGER_OCX" event="OnCustomButtonOnMenuCmd(a,b,c)">-->

    <!--</script>-->
    <!--<script type="text/javascript" for="TANGER_OCX" event="OnDocumentOpened(a,b)">-->

        <!--//document.getElementById("TANGER_OCX").ActiveDocument.IsDefaultSignsGray = true;//设置在文档控件中是否显示为灰色-->
        <!--//document.getElementById("TANGER_OCX").ActiveDocument.SetAllSignsTuomi();//设置所有印章脱密-->
        <!--//document.getElementById("TANGER_OCX").SetAllSecSignsForceShowGray(true);-->
        <!--//document.getElementById("TANGER_OCX").SetAllSecSignsGray(true);-->

        <!--//document.getElementById("TANGER_OCX").ActiveDocument.SetViewPercent(20);-->


    <!--</script>-->
    <!--<script type="text/javascript" for="TANGER_OCX" event="OnFileCommand(a,b)">-->
        <!--//alert("保存到本地试印章变灰");-->
        <!--if(a == 3 || a == 4)-->
        <!--{-->
            <!--//document.getElementById("TANGER_OCX").SetAllSecSignsForceShowGray(true);-->
        <!--}-->
    <!--</script>-->

</head>
<!--<body onload='setTimeout("OpenFile()",1000)'>-->
<body>
<form id="MyFile" action="" method="post" >
    <input type="text" id="FileName" width="200px" />
    <input type="button" onclick="OpenFile()" value="打开服务器上文件" />
    <input type="button" onclick="SaveFile()" value="保存文件到服务器" />
    <input type="button" onclick="SavePDFTOURL()" value="保存为PDF到服务器" />

    <br/>
</form>
</body>
</html>



